home *** CD-ROM | disk | FTP | other *** search
/ One Click 27 / CD da revista One Click #27 - Photoshop Megapack (2005).iso / Interface / it.dig / scripts / __Packages / mx / data / components / DataSet.as < prev    next >
Encoding:
Text File  |  2005-10-28  |  61.4 KB  |  1,975 lines

  1. class mx.data.components.DataSet extends MovieClip
  2. {
  3.    var _loading;
  4.    var _eventDispatcher;
  5.    var super_addBinding;
  6.    var _fldValObj;
  7.    var __schema;
  8.    var __toProperties;
  9.    var _calcFields;
  10.    var _enableEvents;
  11.    var _event;
  12.    var _itemClass;
  13.    var _hasDelta;
  14.    var _deltaPacket;
  15.    var _filterFunc;
  16.    var _filtered;
  17.    var _srcSchema;
  18.    var _defValues;
  19.    var __logChanges;
  20.    var __readOnly;
  21.    var __itemClassName;
  22.    var _trapProperties;
  23.    var __curItem;
  24.    var _dpIndexByTransId;
  25.    var _iterator;
  26.    var getField;
  27.    var __items;
  28.    var __schemaXML;
  29.    var _invalidSchema;
  30.    var _iterators;
  31.    var _itemIndexById;
  32.    var _dpTransIdCount;
  33.    var _lastTransId;
  34.    var _optDeltaItems;
  35.    var _deltaItems;
  36.    var _propCage;
  37.    static var DefaultIterator = "__default__";
  38.    static var ItemId = "__ID__";
  39.    var _allowReslv = false;
  40.    function DataSet()
  41.    {
  42.       super();
  43.       this._loading = false;
  44.       this._eventDispatcher = new Object();
  45.       mx.events.EventDispatcher.initialize(this._eventDispatcher);
  46.       this.super_addBinding = mx.data.binding.ComponentMixins.prototype.addBinding;
  47.       this._fldValObj = new Object();
  48.       this._fldValObj.__schema = this.__schema;
  49.       mx.data.binding.ComponentMixins.initComponent(this._fldValObj);
  50.       mx.data.binding.ComponentMixins.initComponent(this);
  51.       this.__toProperties = new Object();
  52.       this._calcFields = new Object();
  53.       this._calcFields.__length__ = 0;
  54.       this.initCollection();
  55.       this.initIterators();
  56.       this._enableEvents = 0;
  57.       this._event = null;
  58.       this._itemClass = null;
  59.       this._hasDelta = 0;
  60.       this._deltaPacket = null;
  61.       this._filterFunc = null;
  62.       this._visible = false;
  63.       this._filtered = false;
  64.       this._srcSchema = null;
  65.       this._defValues = new Object();
  66.       this._name = this._name != undefined ? this._name : "";
  67.       this.__logChanges = this.__logChanges != undefined ? this.__logChanges : true;
  68.       this.__readOnly = this.__readOnly != undefined ? this.__readOnly : false;
  69.       this.__itemClassName = this.__itemClassName != undefined ? this.__itemClassName : "";
  70.       this._trapProperties = false;
  71.       this.buildSchema();
  72.       this.createProperties();
  73.    }
  74.    function get currentItem()
  75.    {
  76.       return this.__curItem;
  77.    }
  78.    function get deltaPacket()
  79.    {
  80.       return this._deltaPacket;
  81.    }
  82.    function set deltaPacket(dp)
  83.    {
  84.       if(dp != null)
  85.       {
  86.          var _loc9_ = dp.getIterator();
  87.          var _loc5_ = undefined;
  88.          var _loc13_ = new Array();
  89.          var _loc12_ = this._dpIndexByTransId[dp.getTransactionId()];
  90.          if(_loc12_ != undefined)
  91.          {
  92.             this.internalClearDeltaPacket(dp.getTransactionId());
  93.             while(_loc9_.hasNext())
  94.             {
  95.                _loc5_ = mx.data.components.datasetclasses.Delta(_loc9_.next());
  96.                if(_loc12_.items[_loc5_.getId()] == null)
  97.                {
  98.                   throw new mx.data.components.datasetclasses.DataSetError("Couldn\'t resolve item with ID [" + _loc5_.getId() + "] specified in deltaPacket [" + dp.getTransactionId() + "]. Error for DataSet \'" + this._name + "\'.");
  99.                }
  100.                this.applyResolvePacket(_loc5_,_loc13_,_loc12_.items);
  101.             }
  102.             if(_loc13_.length > 0)
  103.             {
  104.                this.internalDispatchEvent("resolveDelta",{data:_loc13_});
  105.             }
  106.          }
  107.          else
  108.          {
  109.             var _loc3_ = undefined;
  110.             var _loc15_ = this.__logChanges;
  111.             this.__logChanges = dp.logChanges() && this.__logChanges;
  112.             this._enableEvents = this._enableEvents - 1;
  113.             var _loc14_ = dp.getKeyInfo();
  114.             this.addSort(dp.getTransactionId(),_loc14_.keyList,_loc14_.options);
  115.             try
  116.             {
  117.                while(_loc9_.hasNext())
  118.                {
  119.                   _loc5_ = mx.data.components.datasetclasses.Delta(_loc9_.next());
  120.                   switch(_loc5_.getOperation())
  121.                   {
  122.                      case mx.data.components.datasetclasses.DeltaPacketConsts.Modified:
  123.                         _loc3_ = this._iterator.find(_loc5_.getSource());
  124.                         if(_loc3_ != null)
  125.                         {
  126.                            var _loc11_ = this.__curItem;
  127.                            try
  128.                            {
  129.                               this.__curItem = _loc3_;
  130.                               var _loc4_ = undefined;
  131.                               var _loc8_ = _loc5_.getChangeList();
  132.                               var _loc6_ = 0;
  133.                               while(_loc6_ < _loc8_.length)
  134.                               {
  135.                                  _loc4_ = _loc8_[_loc6_];
  136.                                  if(_loc4_.kind == mx.data.components.datasetclasses.DeltaItem.Property)
  137.                                  {
  138.                                     var _loc7_ = this.__toProperties[_loc4_.name].type;
  139.                                     this.getField(_loc4_.name).setTypedValue(new mx.data.binding.TypedValue(_loc4_.newValue,_loc7_.name,_loc7_));
  140.                                  }
  141.                                  else
  142.                                  {
  143.                                     this[_loc4_.name].apply(_loc3_,_loc4_.argList);
  144.                                  }
  145.                                  _loc6_ = _loc6_ + 1;
  146.                               }
  147.                            }
  148.                            finally
  149.                            {
  150.                               this.__curItem = _loc11_;
  151.                            }
  152.                         }
  153.                         break;
  154.                      case mx.data.components.datasetclasses.DeltaPacketConsts.Added:
  155.                         _loc3_ = this.convertToRaw(_loc5_.getSource(true));
  156.                         _loc3_ = this.createItem(_loc3_);
  157.                         this.addItem(_loc3_);
  158.                         break;
  159.                      case mx.data.components.datasetclasses.DeltaPacketConsts.Removed:
  160.                         _loc3_ = this.convertToRaw(_loc5_.getSource());
  161.                         _loc3_ = this._iterator.find(_loc3_);
  162.                         if(_loc3_ != null)
  163.                         {
  164.                            this.removeItem(_loc3_);
  165.                         }
  166.                   }
  167.                   if(_loc3_ == null)
  168.                   {
  169.                      _global.__dataLogger.logData(null,"Couldn\'t find the following item:",_loc5_.getSource());
  170.                   }
  171.                }
  172.             }
  173.             finally
  174.             {
  175.                this.removeSort(dp.getTransactionId());
  176.                this._enableEvents = this._enableEvents + 1;
  177.                this.__logChanges = _loc15_;
  178.             }
  179.          }
  180.       }
  181.    }
  182.    function get dataProvider()
  183.    {
  184.       return new mx.data.components.datasetclasses.DataSetDataProvider(this);
  185.    }
  186.    function set dataProvider(dp)
  187.    {
  188.       if(dp != null)
  189.       {
  190.          this._loading = true;
  191.          var _loc6_ = this.__logChanges;
  192.          try
  193.          {
  194.             this.__logChanges = false;
  195.             this.initCollection();
  196.             if(dp.length > 0 && this.hasInvalidSchema())
  197.             {
  198.                this.defaultSchema(dp.getItemAt(0),true);
  199.             }
  200.             var _loc5_ = this._itemClass != null || this.__itemClassName.length > 0 || this._eventDispatcher.__q_newItem != undefined;
  201.             var _loc3_ = undefined;
  202.             var _loc2_ = 0;
  203.             while(_loc2_ < dp.length)
  204.             {
  205.                _loc3_ = dp.getItemAt(_loc2_);
  206.                _loc3_ = !_loc5_ ? _loc3_ : this.createItem(_loc3_);
  207.                this.internalAddItem(_loc3_,_loc2_,false,true);
  208.                _loc2_ = _loc2_ + 1;
  209.             }
  210.             this.rebuildItemIndexById();
  211.             this.initIterators();
  212.             this.internalDispatchEvent("afterLoaded");
  213.             this.internalDispatchEvent("modelChanged",{eventName:"updateAll",firstItem:0,lastItem:this.length});
  214.          }
  215.          finally
  216.          {
  217.             this.__logChanges = _loc6_;
  218.             this._loading = false;
  219.          }
  220.       }
  221.    }
  222.    function get filtered()
  223.    {
  224.       return this._filtered;
  225.    }
  226.    function set filtered(value)
  227.    {
  228.       if(this._filtered != value)
  229.       {
  230.          if(this._iterator.setFiltered(value) != 0)
  231.          {
  232.             this.__curItem = this.internalFirst();
  233.             this.internalDispatchEvent("modelChanged",{eventName:"filterModel"});
  234.          }
  235.          this._filtered = value;
  236.       }
  237.    }
  238.    function get filterFunc()
  239.    {
  240.       return this._filterFunc;
  241.    }
  242.    function set filterFunc(value)
  243.    {
  244.       if(this._filterFunc != value)
  245.       {
  246.          if(this._iterator.setFilterFunc(value) != 0)
  247.          {
  248.             this.__curItem = this.internalFirst();
  249.             this.internalDispatchEvent("modelChanged",{eventName:"filterModel"});
  250.          }
  251.          this._filterFunc = value;
  252.       }
  253.    }
  254.    function get items()
  255.    {
  256.       return this.__items;
  257.    }
  258.    function set items(itms)
  259.    {
  260.       var _loc6_ = this.__logChanges;
  261.       this._loading = true;
  262.       try
  263.       {
  264.          this.__logChanges = false;
  265.          this.initCollection();
  266.          if(itms.length > 0 && this.hasInvalidSchema())
  267.          {
  268.             this.defaultSchema(itms[0]);
  269.          }
  270.          var _loc5_ = this._itemClass != null || this.__itemClassName.length > 0 || this._eventDispatcher.__q_newItem != undefined;
  271.          var _loc3_ = undefined;
  272.          var _loc2_ = 0;
  273.          while(_loc2_ < itms.length)
  274.          {
  275.             _loc3_ = itms[_loc2_];
  276.             _loc3_ = !_loc5_ ? _loc3_ : this.createItem(_loc3_);
  277.             this.internalAddItem(_loc3_,_loc2_,false,false);
  278.             _loc2_ = _loc2_ + 1;
  279.          }
  280.          this.rebuildItemIndexById();
  281.          this.initIterators();
  282.          this.internalDispatchEvent("afterLoaded");
  283.          this.internalDispatchEvent("modelChanged",{eventName:"updateAll",firstItem:0,lastItem:this.length});
  284.       }
  285.       finally
  286.       {
  287.          this.__logChanges = _loc6_;
  288.          this._loading = false;
  289.       }
  290.    }
  291.    function get itemClassName()
  292.    {
  293.       return this.__itemClassName;
  294.    }
  295.    function set itemClassName(value)
  296.    {
  297.       if(this.__itemClassName != value && this.__items.length > 0)
  298.       {
  299.          throw new mx.data.components.datasetclasses.DataSetError("ItemClass can not be changed when there are already items in the collection. Error for DataSet \'" + this._name + "\'.");
  300.       }
  301.       this.__itemClassName = value;
  302.       this._itemClass = null;
  303.    }
  304.    function get length()
  305.    {
  306.       return this.getLength();
  307.    }
  308.    function get logChanges()
  309.    {
  310.       return this.__logChanges;
  311.    }
  312.    function set logChanges(value)
  313.    {
  314.       this.__logChanges = value;
  315.    }
  316.    function get properties()
  317.    {
  318.       return this.__toProperties;
  319.    }
  320.    function get readOnly()
  321.    {
  322.       return this.__readOnly;
  323.    }
  324.    function set readOnly(value)
  325.    {
  326.       this.__readOnly = value;
  327.    }
  328.    function get schema()
  329.    {
  330.       return this.__schemaXML;
  331.    }
  332.    function set schema(sch)
  333.    {
  334.       if(sch.firstChild.nodeName != "properties")
  335.       {
  336.          throw new mx.data.components.datasetclasses.DataSetError("First node of schema XML must be \'properties\'");
  337.       }
  338.       this.__schema = new Object();
  339.       this.__schema.elements = new Array();
  340.       var _loc3_ = sch.firstChild.childNodes;
  341.       var _loc2_ = undefined;
  342.       var _loc6_ = undefined;
  343.       for(var _loc4_ in _loc3_)
  344.       {
  345.          _loc2_ = _loc3_[_loc4_];
  346.          if(_loc2_.nodeName == "property")
  347.          {
  348.             this.__schema.elements.push(this.getSchemaObject(_loc2_));
  349.          }
  350.       }
  351.       this.__schemaXML = sch;
  352.       this._invalidSchema = false;
  353.       this.createProperties();
  354.    }
  355.    function get selectedIndex()
  356.    {
  357.       return this._iterator.getItemIndex(this.__curItem);
  358.    }
  359.    function set selectedIndex(index)
  360.    {
  361.       var _loc2_ = this._iterator.getItemAt(index);
  362.       if(_loc2_ != null)
  363.       {
  364.          this.__curItem = _loc2_;
  365.          this._iterator.find(_loc2_);
  366.          this.internalDispatchEvent("iteratorScrolled");
  367.       }
  368.    }
  369.    function addBinding(aBinding)
  370.    {
  371.       var _loc2_ = null;
  372.       if(aBinding.source.component == this)
  373.       {
  374.          _loc2_ = aBinding.source;
  375.          if(_loc2_.property == "dataProvider")
  376.          {
  377.             Object(aBinding).queueForExecute();
  378.             _loc2_.event = "NoEvent";
  379.             _loc2_ = null;
  380.          }
  381.       }
  382.       if(aBinding.dest.component == this)
  383.       {
  384.          _loc2_ = aBinding.dest;
  385.       }
  386.       if(_loc2_ != null)
  387.       {
  388.          var _loc4_ = _loc2_.property;
  389.          if(_loc4_ != "deltaPacket" && _loc4_ != "items")
  390.          {
  391.             _loc2_.event = new Array("iteratorScrolled","modelChanged");
  392.          }
  393.       }
  394.       this.super_addBinding(aBinding);
  395.    }
  396.    function addEventListener(name, handler)
  397.    {
  398.       this._eventDispatcher.addEventListener(name,handler);
  399.    }
  400.    function addSort(name, propList, options)
  401.    {
  402.       if(this.hasSort(name))
  403.       {
  404.          throw new mx.data.components.datasetclasses.DataSetError("Sort \'" + name + "\' specified is already added.  Error for dataset \'" + this._name + "\'.");
  405.       }
  406.       var _loc4_ = null;
  407.       var _loc2_ = 0;
  408.       while(_loc2_ < propList.length)
  409.       {
  410.          _loc4_ = this.__toProperties[propList[_loc2_]];
  411.          if(_loc4_ == null)
  412.          {
  413.             throw new mx.data.components.datasetclasses.DataSetError("Property \'" + propList[_loc2_] + "\' not found in schema for DataSet \'" + this._name + "\' can\'t build index.");
  414.          }
  415.          this.addSortInfo(this.getField(_loc4_.name),name,_loc2_);
  416.          _loc2_ = _loc2_ + 1;
  417.       }
  418.       var _loc6_ = new mx.data.components.datasetclasses.DataSetIterator(name,this,this._iterators[mx.data.components.DataSet.DefaultIterator]);
  419.       _loc6_.setFilterFunc(this._filterFunc);
  420.       _loc6_.setFiltered(this._filtered);
  421.       _loc6_.sortOn(propList,options);
  422.       this._iterators[name] = _loc6_;
  423.       this._iterator = _loc6_;
  424.       this.__curItem = this._iterator.next();
  425.       this.internalDispatchEvent("modelChanged",{eventName:"sort"});
  426.    }
  427.    function addItem(transferObj)
  428.    {
  429.       if(arguments.length > 0 && transferObj == null)
  430.       {
  431.          return false;
  432.       }
  433.       return this.addItemAt(this.length,transferObj);
  434.    }
  435.    function addItemAt(index, transferObj)
  436.    {
  437.       this.checkReadOnly();
  438.       var _loc5_ = true;
  439.       if(transferObj == undefined)
  440.       {
  441.          transferObj = this.createItem(null);
  442.       }
  443.       else
  444.       {
  445.          var _loc7_ = transferObj[mx.data.components.DataSet.ItemId];
  446.          _loc5_ = _loc7_ == undefined || this._itemIndexById[_loc7_] == undefined;
  447.       }
  448.       if(_loc5_)
  449.       {
  450.          if(this.hasInvalidSchema())
  451.          {
  452.             this.defaultSchema(transferObj);
  453.          }
  454.          var _loc4_ = this.internalDispatchEvent("addItem",{item:transferObj,result:true});
  455.          _loc5_ = _loc4_ == null || _loc4_.result;
  456.          if(_loc5_ && index <= this.length)
  457.          {
  458.             _loc7_ = this.internalAddItem(transferObj,index,true,false);
  459.             if(this.__logChanges)
  460.             {
  461.                this.logAddItem(transferObj,false);
  462.             }
  463.             _loc4_ = {eventName:"addItems",firstItem:index,lastItem:index};
  464.             this.resyncIterators(_loc4_);
  465.             var _loc6_ = this._iterator.find({__ID__:_loc7_});
  466.             if(_loc6_ != null)
  467.             {
  468.                this.__curItem = _loc6_;
  469.             }
  470.             this.internalDispatchEvent("modelChanged",_loc4_);
  471.             if(this._enableEvents < 0 && this._event != null)
  472.             {
  473.                this._event.data.lastItem = index;
  474.             }
  475.          }
  476.       }
  477.       return _loc5_;
  478.    }
  479.    function applyUpdates()
  480.    {
  481.       if(this._hasDelta > 0)
  482.       {
  483.          var _loc2_ = this.getDPTransId();
  484.          var _loc4_ = 0;
  485.          if(this._dpTransIdCount == 0)
  486.          {
  487.             this._lastTransId = _loc2_;
  488.          }
  489.          else
  490.          {
  491.             _loc4_ = this._dpIndexByTransId[this._lastTransId].index;
  492.          }
  493.          this._dpIndexByTransId[_loc2_] = {index:this._deltaItems.length,prevId:this._lastTransId,items:this._optDeltaItems};
  494.          this._dpTransIdCount = this._dpTransIdCount + 1;
  495.          this._deltaPacket = new mx.data.components.datasetclasses.DeltaPacketImpl(this,_loc2_,this.getKeyInfo(),false,this._srcSchema);
  496.          for(var _loc3_ in this._optDeltaItems)
  497.          {
  498.             this._deltaPacket.addItem(this._optDeltaItems[_loc3_]);
  499.          }
  500.          this._lastTransId = _loc2_;
  501.          this._optDeltaItems = new Array();
  502.          this._hasDelta = 0;
  503.          this.internalDispatchEvent("deltaPacketChanged");
  504.       }
  505.       else
  506.       {
  507.          this._deltaPacket = null;
  508.       }
  509.    }
  510.    function clear()
  511.    {
  512.       var _loc4_ = new Array();
  513.       var _loc5_ = new Array();
  514.       var _loc2_ = undefined;
  515.       var _loc6_ = undefined;
  516.       var _loc8_ = this._iterator.getLength();
  517.       var _loc3_ = 0;
  518.       while(_loc3_ < this.__items.length)
  519.       {
  520.          _loc2_ = this.__items[_loc3_];
  521.          _loc6_ = _loc2_[mx.data.components.DataSet.ItemId];
  522.          if(this._iterator.contains(_loc2_))
  523.          {
  524.             if(this.__logChanges)
  525.             {
  526.                this.logRemoveItem(_loc2_,false);
  527.             }
  528.             _loc5_.push(_loc2_[mx.data.components.DataSet.ItemId]);
  529.          }
  530.          else
  531.          {
  532.             _loc4_.push(_loc2_);
  533.          }
  534.          _loc3_ = _loc3_ + 1;
  535.       }
  536.       this.__items = _loc4_;
  537.       this.rebuildItemIndexById();
  538.       var _loc7_ = {eventName:"removeItems",firstItem:0,lastItem:_loc8_,removedIDs:_loc5_};
  539.       this.resyncIterators(_loc7_);
  540.       this.__curItem = this.getCurrentItem();
  541.       delete _loc7_[this.items];
  542.       this.internalDispatchEvent("modelChanged",_loc7_);
  543.    }
  544.    function createItem(itemData)
  545.    {
  546.       this.checkSchema();
  547.       var _loc5_ = null;
  548.       if(this._itemClass == null)
  549.       {
  550.          if(this.__itemClassName.length > 0)
  551.          {
  552.             this._itemClass = mx.utils.ClassFinder.findClass(this.__itemClassName);
  553.             if(this._itemClass == null)
  554.             {
  555.                throw new mx.data.components.datasetclasses.DataSetError("Item class \'" + this.__itemClassName + "\' specified not found. Error for DataSet \'" + this._name + "\'.");
  556.             }
  557.          }
  558.          else
  559.          {
  560.             this._itemClass = Function(Object);
  561.          }
  562.       }
  563.       if(itemData == null)
  564.       {
  565.          this._propCage = new Object();
  566.          this._trapProperties = true;
  567.          try
  568.          {
  569.             var _loc2_ = undefined;
  570.             for(var _loc3_ in this.__toProperties)
  571.             {
  572.                _loc2_ = this._defValues[_loc3_];
  573.                if(_loc2_ != null)
  574.                {
  575.                   this.getField(_loc3_).setTypedValue(new mx.data.binding.TypedValue(_loc2_,"String"));
  576.                }
  577.             }
  578.             itemData = this._propCage;
  579.          }
  580.          finally
  581.          {
  582.             this._trapProperties = false;
  583.          }
  584.       }
  585.       if(this._itemClass == Object)
  586.       {
  587.          _loc5_ = itemData;
  588.       }
  589.       else
  590.       {
  591.          _loc5_ = new this._itemClass();
  592.       }
  593.       _loc5_.setPropertyData(itemData);
  594.       this.internalDispatchEvent("newItem",{item:_loc5_});
  595.       return _loc5_;
  596.    }
  597.    function disableEvents()
  598.    {
  599.       this._enableEvents = this._enableEvents - 1;
  600.    }
  601.    function dispatchEvent(eventObj)
  602.    {
  603.       this.internalDispatchEvent(eventObj.type,eventObj);
  604.    }
  605.    function enableEvents()
  606.    {
  607.       if(this._enableEvents < 0)
  608.       {
  609.          this._enableEvents = this._enableEvents + 1;
  610.       }
  611.       if(this._enableEvents == 0)
  612.       {
  613.          this.internalDispatchEvent(this._event.type,this._event.data);
  614.          this._event = null;
  615.       }
  616.    }
  617.    function find(values)
  618.    {
  619.       var _loc2_ = this._iterator.find(this.convertToRaw(values));
  620.       if(_loc2_ != null)
  621.       {
  622.          this.__curItem = _loc2_;
  623.          this.internalDispatchEvent("iteratorScrolled");
  624.       }
  625.       return _loc2_ != null;
  626.    }
  627.    function findFirst(values)
  628.    {
  629.       var _loc2_ = this._iterator.findFirst(this.convertToRaw(values));
  630.       if(_loc2_ != null)
  631.       {
  632.          this.__curItem = _loc2_;
  633.          this.internalDispatchEvent("iteratorScrolled");
  634.       }
  635.       return _loc2_ != null;
  636.    }
  637.    function findLast(values)
  638.    {
  639.       var _loc2_ = this._iterator.findLast(this.convertToRaw(values));
  640.       if(_loc2_ != null)
  641.       {
  642.          this.__curItem = _loc2_;
  643.          this.internalDispatchEvent("iteratorScrolled");
  644.       }
  645.       return _loc2_ != null;
  646.    }
  647.    function first()
  648.    {
  649.       var _loc2_ = this.internalFirst();
  650.       if(this.__curItem != _loc2_)
  651.       {
  652.          this.__curItem = _loc2_;
  653.          this.internalDispatchEvent("iteratorScrolled");
  654.       }
  655.    }
  656.    function getItemId(index)
  657.    {
  658.       var _loc2_ = "";
  659.       if(this.getLength() > 0)
  660.       {
  661.          _loc2_ = index != undefined ? this._iterator.getItemId(index) : this.__curItem[mx.data.components.DataSet.ItemId];
  662.       }
  663.       return _loc2_;
  664.    }
  665.    function getIterator()
  666.    {
  667.       var _loc3_ = this.internalGetId();
  668.       var _loc2_ = new mx.data.components.datasetclasses.DataSetIterator(_loc3_,this,mx.data.components.datasetclasses.DataSetIterator(this._iterator));
  669.       _loc2_.first();
  670.       this._iterators[_loc3_] = _loc2_;
  671.       return _loc2_;
  672.    }
  673.    function getLength()
  674.    {
  675.       return this._iterator.getLength();
  676.    }
  677.    function hasNext()
  678.    {
  679.       return this._iterator.getLength() > 0 && (this._iterator.hasNext() || this._iterator.getCurrentItem() != null);
  680.    }
  681.    function hasPrevious()
  682.    {
  683.       return this._iterator.getLength() > 0 && (this._iterator.hasPrevious() || this._iterator.getCurrentItem() != null);
  684.    }
  685.    function hasSort(name)
  686.    {
  687.       return this._iterators[name] != undefined;
  688.    }
  689.    function isEmpty()
  690.    {
  691.       return this.length == 0;
  692.    }
  693.    function clearDelta(id)
  694.    {
  695.       return this.removeDelta(this._optDeltaItems[id]);
  696.    }
  697.    function changesPending()
  698.    {
  699.       return this._hasDelta > 0;
  700.    }
  701.    function locateById(id)
  702.    {
  703.       var _loc2_ = this._iterator.find({__ID__:id});
  704.       if(_loc2_ != null)
  705.       {
  706.          this.__curItem = _loc2_;
  707.          this.internalDispatchEvent("iteratorScrolled");
  708.       }
  709.       return _loc2_ != null;
  710.    }
  711.    function last()
  712.    {
  713.       this._iterator.last();
  714.       var _loc2_ = this._iterator.previous();
  715.       this._iterator.next();
  716.       if(this.__curItem != _loc2_)
  717.       {
  718.          this.__curItem = _loc2_;
  719.          this.internalDispatchEvent("iteratorScrolled");
  720.       }
  721.    }
  722.    function loadFromSharedObj(objName, localPath)
  723.    {
  724.       var _loc7_ = SharedObject.getLocal(objName,localPath);
  725.       if(_loc7_.data.items != undefined)
  726.       {
  727.          this.items = _loc7_.data.items;
  728.          var _loc4_ = _loc7_.data.optDelta;
  729.          this._optDeltaItems = new Array();
  730.          var _loc2_ = undefined;
  731.          for(var _loc8_ in _loc4_)
  732.          {
  733.             _loc2_ = _loc4_[_loc8_];
  734.             this._optDeltaItems[_loc2_._id] = this.createDelta(_loc2_);
  735.          }
  736.          _loc4_ = _loc7_.data.delta;
  737.          this._deltaItems = new Array();
  738.          var _loc8_ = 0;
  739.          while(_loc8_ < _loc4_.length)
  740.          {
  741.             _loc2_ = _loc4_[_loc8_];
  742.             if(this._optDeltaItems[_loc2_._id] == undefined)
  743.             {
  744.                d = this.createDelta(_loc2_);
  745.             }
  746.             else
  747.             {
  748.                d = this._optDeltaItems[_loc2_._id];
  749.             }
  750.             this._deltaItems.push(d);
  751.             _loc8_ = _loc8_ + 1;
  752.          }
  753.          var _loc5_ = _loc7_.data.dpIndex;
  754.          var _loc3_ = undefined;
  755.          for(_loc8_ in _loc5_)
  756.          {
  757.             _loc3_ = _loc5_[_loc8_].items;
  758.             for(var _loc6_ in _loc3_)
  759.             {
  760.                _loc3_[_loc6_] = this.findDelta(_loc6_);
  761.             }
  762.          }
  763.          this._dpIndexByTransId = _loc5_;
  764.          this._lastTransId = _loc7_.data.lastTransId;
  765.          this._dpTransIdCount = _loc7_.data.transIdCount;
  766.          this._hasDelta = _loc7_.data.hasDelta;
  767.       }
  768.    }
  769.    function next()
  770.    {
  771.       var _loc2_ = this._iterator.next();
  772.       if(_loc2_ != null)
  773.       {
  774.          if(_loc2_ == this.__curItem)
  775.          {
  776.             _loc2_ = this._iterator.next();
  777.          }
  778.          if(_loc2_ != null)
  779.          {
  780.             this.__curItem = _loc2_;
  781.             this.internalDispatchEvent("iteratorScrolled");
  782.          }
  783.       }
  784.    }
  785.    function previous()
  786.    {
  787.       var _loc2_ = this._iterator.previous();
  788.       if(_loc2_ != null)
  789.       {
  790.          if(_loc2_ == this.__curItem)
  791.          {
  792.             _loc2_ = this._iterator.previous();
  793.          }
  794.          if(_loc2_ != null)
  795.          {
  796.             this.__curItem = _loc2_;
  797.             this.internalDispatchEvent("iteratorScrolled");
  798.          }
  799.       }
  800.    }
  801.    function propertyModified(propName, subProp, typeInfo)
  802.    {
  803.       if(propName == "dataProvider" || propName == "items")
  804.       {
  805.          this._srcSchema = typeInfo;
  806.       }
  807.    }
  808.    function removeAll()
  809.    {
  810.       var _loc3_ = this.__items.length;
  811.       var _loc2_ = 0;
  812.       while(_loc2_ < _loc3_)
  813.       {
  814.          if(this.__logChanges)
  815.          {
  816.             this.logRemoveItem(this.__items[_loc2_],false);
  817.          }
  818.          _loc2_ = _loc2_ + 1;
  819.       }
  820.       this.__items = new Array();
  821.       this._itemIndexById = new Array();
  822.       var _loc4_ = {eventName:"removeItems",firstItem:0,lastItem:_loc3_};
  823.       this.resyncIterators(_loc4_);
  824.       this.internalDispatchEvent("modelChanged",_loc4_);
  825.    }
  826.    function removeEventListener(name, handler)
  827.    {
  828.       this._eventDispatcher.removeEventListener(name,handler);
  829.    }
  830.    function removeItem(item)
  831.    {
  832.       if(arguments.length > 0 && item == null)
  833.       {
  834.          return false;
  835.       }
  836.       if(item == null)
  837.       {
  838.          item = this.__curItem;
  839.       }
  840.       var _loc4_ = this._itemIndexById[item[mx.data.components.DataSet.ItemId]];
  841.       if(_loc4_ != undefined)
  842.       {
  843.          return this.internalRemoveItem(item);
  844.       }
  845.       return false;
  846.    }
  847.    function removeItemAt(index)
  848.    {
  849.       return this.internalRemoveItem(this._iterator.getItemAt(index));
  850.    }
  851.    function removeRange()
  852.    {
  853.       this._iterator.removeRange();
  854.       this.__curItem = this.internalFirst();
  855.       this.internalDispatchEvent("modelChanged",{eventName:"filterModel"});
  856.    }
  857.    function removeSort(name)
  858.    {
  859.       if(this._iterators[name] != undefined)
  860.       {
  861.          if(name != mx.data.components.DataSet.DefaultIterator)
  862.          {
  863.             if(this._iterator.getId() == name)
  864.             {
  865.                this.setIterator(this._iterators[mx.data.components.DataSet.DefaultIterator]);
  866.             }
  867.             var _loc3_ = this._iterators[name].getSortInfo();
  868.             var _loc2_ = 0;
  869.             while(_loc2_ < _loc3_.keyList.length)
  870.             {
  871.                this.removeSortInfo(this.getField(_loc3_.keyList[_loc2_]),name);
  872.                _loc2_ = _loc2_ + 1;
  873.             }
  874.             delete this._iterators[name];
  875.          }
  876.          throw new mx.data.components.datasetclasses.DataSetError("The default index can not be removed.  Error on DataSet \'" + this._name + "\'.");
  877.       }
  878.       throw new mx.data.components.datasetclasses.DataSetError("Sort \'" + name + "\' specified does not exist.  Error on DataSet \'" + this._name + "\'.");
  879.    }
  880.    function skip(offset)
  881.    {
  882.       var _loc2_ = this._iterator.skip(offset);
  883.       if(_loc2_ == null)
  884.       {
  885.          if(offset > 0)
  886.          {
  887.             _loc2_ = this._iterator.previous();
  888.          }
  889.          else
  890.          {
  891.             _loc2_ = this._iterator.next();
  892.          }
  893.       }
  894.       if(this.__curItem != _loc2_)
  895.       {
  896.          this.__curItem = _loc2_;
  897.          this.internalDispatchEvent("iteratorScrolled");
  898.       }
  899.       return this;
  900.    }
  901.    function saveToSharedObj(objName, localPath)
  902.    {
  903.       var _loc2_ = SharedObject.getLocal(objName,localPath);
  904.       if(_loc2_ == null)
  905.       {
  906.          throw new mx.data.components.datasetclasses.DataSetError("Couldn\'t access specified shared object. Error for DataSet \'" + this._name + "\'.");
  907.       }
  908.       _loc2_.data.items = this.__items;
  909.       _loc2_.data.optDelta = this._optDeltaItems;
  910.       _loc2_.data.delta = this._deltaItems;
  911.       _loc2_.data.dpIndex = this._dpIndexByTransId;
  912.       _loc2_.data.lastTransId = this._lastTransId;
  913.       _loc2_.data.transIdCount = this._dpTransIdCount;
  914.       _loc2_.data.hasDelta = this._hasDelta;
  915.       if(_loc2_.flush() == false)
  916.       {
  917.          throw new mx.data.components.datasetclasses.DataSetError("Couldn\'t save shared object not sufficient space or rights. Error for DataSet \'" + this._name + "\'.");
  918.       }
  919.    }
  920.    function setIterator(newIterator)
  921.    {
  922.       if(this._iterators[newIterator.getId()] == undefined)
  923.       {
  924.          throw new mx.data.components.datasetclasses.DataSetError("Can\'t assign foreign iterator \'" + newIterator.getId() + "\' to DataSet \'" + this._name + "\'.");
  925.       }
  926.       this._iterator = newIterator;
  927.       this.__curItem = this.getCurrentItem();
  928.       this.internalDispatchEvent("modelChanged",{eventName:"filterModel"});
  929.    }
  930.    function setRange(startValues, endValues)
  931.    {
  932.       this._iterator.setRange(this.convertToRaw(startValues),this.convertToRaw(endValues));
  933.       this.__curItem = this.internalFirst();
  934.       this.internalDispatchEvent("modelChanged",{eventName:"filterModel"});
  935.    }
  936.    function useSort(sortName, options)
  937.    {
  938.       if(!this.hasSort(sortName))
  939.       {
  940.          throw new mx.data.components.datasetclasses.DataSetError("Sort specified \'" + sortName + "\' does\'nt exist for DataSet \'" + this._name + "\'.");
  941.       }
  942.       var _loc2_ = this._iterators[sortName];
  943.       if(options != undefined)
  944.       {
  945.          _loc2_.setSortOptions(options);
  946.       }
  947.       _loc2_.setFiltered(this._filtered);
  948.       _loc2_.setFilterFunc(this._filterFunc);
  949.       this._iterator = _loc2_;
  950.       this.first();
  951.       this.internalDispatchEvent("modelChanged",{eventName:"sort"});
  952.    }
  953.    function addProxy()
  954.    {
  955.       var _loc2_ = undefined;
  956.       for(var _loc3_ in this.__toProperties)
  957.       {
  958.          _loc2_ = String(_loc3_);
  959.          this.addProperty(_loc2_,this["get_" + _loc2_],this["set_" + _loc2_]);
  960.       }
  961.    }
  962.    function addSortInfo(fld, name, index)
  963.    {
  964.       if(fld.sortInfo == null)
  965.       {
  966.          fld.sortInfo = new Array();
  967.       }
  968.       fld.sortInfo[name] = index;
  969.    }
  970.    function applyResolvePacket(d, resPckt, dpItems)
  971.    {
  972.       var _loc9_ = resPckt.length;
  973.       if(d.getMessage().length > 0)
  974.       {
  975.          resPckt.push(Object(d));
  976.       }
  977.       else
  978.       {
  979.          var _loc3_ = d.getChangeList();
  980.          var _loc4_ = true;
  981.          var _loc2_ = 0;
  982.          while(_loc2_ < _loc3_.length && _loc4_)
  983.          {
  984.             _loc4_ = _loc3_[_loc2_].message.length == 0;
  985.             _loc2_ = _loc2_ + 1;
  986.          }
  987.          if(_loc2_ < _loc3_.length)
  988.          {
  989.             resPckt.push(Object(d));
  990.          }
  991.       }
  992.       var _loc6_ = _loc9_ != resPckt.length;
  993.       switch(d.getOperation())
  994.       {
  995.          case mx.data.components.datasetclasses.DeltaPacketConsts.Added:
  996.             if(_loc6_)
  997.             {
  998.                this.logAddItem(d.getSource(),true,d.getId());
  999.             }
  1000.             else
  1001.             {
  1002.                this.updateItem(d);
  1003.             }
  1004.             break;
  1005.          case mx.data.components.datasetclasses.DeltaPacketConsts.Removed:
  1006.             if(_loc6_)
  1007.             {
  1008.                this.logRemoveItem(d.getSource(),true,d.getId());
  1009.             }
  1010.             break;
  1011.          case mx.data.components.datasetclasses.DeltaPacketConsts.Modified:
  1012.             if(!_loc6_)
  1013.             {
  1014.                this.updateItem(d);
  1015.             }
  1016.             else
  1017.             {
  1018.                var _loc7_ = dpItems[d.getId()];
  1019.                this._optDeltaItems[d.getId()] = _loc7_;
  1020.                this._deltaItems.push(Object(_loc7_));
  1021.                this._hasDelta = this._hasDelta + 1;
  1022.             }
  1023.       }
  1024.    }
  1025.    function buildSchema()
  1026.    {
  1027.       if(this.hasInvalidSchema())
  1028.       {
  1029.          this.__schemaXML = new XML("<properties/>");
  1030.       }
  1031.       else
  1032.       {
  1033.          var _loc4_ = this.__schema.elements;
  1034.          var _loc2_ = undefined;
  1035.          var _loc6_ = "<properties>";
  1036.          var _loc3_ = 0;
  1037.          while(_loc3_ < _loc4_.length)
  1038.          {
  1039.             _loc2_ = _loc4_[_loc3_];
  1040.             if(this.isValidElement(_loc2_))
  1041.             {
  1042.                if(_loc2_.type.name == "Date" && _loc2_.type.encoder == undefined)
  1043.                {
  1044.                   _loc2_.type.encoder = {className:"mx.data.encoders.DateToNumber"};
  1045.                }
  1046.                _loc6_ += "<property name=\"" + _loc2_.name + "\">" + this.getSchemaXML("type",_loc2_.type) + "</property>";
  1047.             }
  1048.             _loc3_ = _loc3_ + 1;
  1049.          }
  1050.          _loc6_ += "</properties>";
  1051.          this.__schemaXML = new XML(_loc6_);
  1052.       }
  1053.    }
  1054.    function createDelta(td)
  1055.    {
  1056.       var _loc10_ = undefined;
  1057.       var _loc1_ = undefined;
  1058.       var _loc3_ = undefined;
  1059.       _loc10_ = new mx.data.components.datasetclasses.DeltaImpl(td._id,td._source,td._op,td._message,td._accessCl);
  1060.       var _loc2_ = 0;
  1061.       while(_loc2_ < td._deltaItems.length)
  1062.       {
  1063.          _loc1_ = td._deltaItems[_loc2_];
  1064.          if(_loc1_.__kind == mx.data.components.datasetclasses.DeltaItem.Property)
  1065.          {
  1066.             _loc3_ = {newValue:_loc1_.__newValue,oldValue:_loc1_.__oldValue,curValue:_loc1_.__curValue,message:_loc1_.__message};
  1067.          }
  1068.          else
  1069.          {
  1070.             _loc3_ = {argList:_loc1_.__argList};
  1071.          }
  1072.          new mx.data.components.datasetclasses.DeltaItem(_loc1_.__kind,_loc1_.__name,_loc3_,Object(_loc10_));
  1073.          _loc2_ = _loc2_ + 1;
  1074.       }
  1075.       return _loc10_;
  1076.    }
  1077.    function checkReadOnly()
  1078.    {
  1079.       if(this.__readOnly)
  1080.       {
  1081.          throw new mx.data.components.datasetclasses.DataSetError("Can\'t modify a read only DataSet.  Error for \'" + Object(this)._name + "\'.");
  1082.       }
  1083.    }
  1084.    function checkSchema()
  1085.    {
  1086.       if(this.hasInvalidSchema())
  1087.       {
  1088.          throw new mx.data.components.datasetclasses.DataSetError("Schema has not been specified. Can\'t construct item. Error for DataSet \'" + this._name + "\'.");
  1089.       }
  1090.    }
  1091.    function createProperties()
  1092.    {
  1093.       this.removeProxy();
  1094.       this._allowReslv = true;
  1095.       this._calcFields.__length__ = 0;
  1096.       this.__toProperties = new Object();
  1097.       var _loc2_ = undefined;
  1098.       var _loc3_ = 0;
  1099.       while(_loc3_ < this.__schema.elements.length)
  1100.       {
  1101.          _loc2_ = this.__schema.elements[_loc3_];
  1102.          if(this.isValidElement(_loc2_))
  1103.          {
  1104.             this.__toProperties[_loc2_.name] = _loc2_;
  1105.             if(_loc2_.type.value != null)
  1106.             {
  1107.                this._defValues[_loc2_.name] = _loc2_.type.value;
  1108.                _loc2_.type.value = null;
  1109.             }
  1110.             if(this.getField(_loc2_.name).kind.isCalculated)
  1111.             {
  1112.                this._calcFields[_loc2_.name] = _loc2_;
  1113.                this._calcFields.__length__ = this._calcFields.__length__ + 1;
  1114.             }
  1115.          }
  1116.          _loc3_ = _loc3_ + 1;
  1117.       }
  1118.       this.addProxy();
  1119.       this._allowReslv = this.__items.length > 0;
  1120.    }
  1121.    function convertToRaw(values)
  1122.    {
  1123.       if(values instanceof Array)
  1124.       {
  1125.          return this.convertArrayToRaw(values);
  1126.       }
  1127.       return this.convertObjectToRaw(values);
  1128.    }
  1129.    function convertArrayToRaw(values)
  1130.    {
  1131.       this._trapProperties = true;
  1132.       this._propCage = new Object();
  1133.       try
  1134.       {
  1135.          var _loc5_ = this._iterator.getSortInfo();
  1136.          var _loc4_ = undefined;
  1137.          var _loc6_ = undefined;
  1138.          var _loc3_ = undefined;
  1139.          var _loc2_ = 0;
  1140.          while(_loc2_ < _loc5_.keyList.length)
  1141.          {
  1142.             if(_loc2_ < values.length)
  1143.             {
  1144.                _loc4_ = this.getField(_loc5_.keyList[_loc2_]);
  1145.                _loc6_ = this.__toProperties[_loc5_.keyList[_loc2_]].type;
  1146.                _loc3_ = values[_loc2_];
  1147.                switch(typeof _loc3_)
  1148.                {
  1149.                   case "string":
  1150.                      _loc4_.setAsString(_loc3_);
  1151.                      break;
  1152.                   case "boolean":
  1153.                      _loc4_.setAsBoolean(_loc3_);
  1154.                      break;
  1155.                   case "number":
  1156.                      _loc4_.setAsNumber(_loc3_);
  1157.                      break;
  1158.                   case "object":
  1159.                      _loc4_.setTypedValue(new mx.data.binding.TypedValue(_loc3_,_loc6_.name,_loc6_));
  1160.                }
  1161.             }
  1162.             _loc2_ = _loc2_ + 1;
  1163.          }
  1164.       }
  1165.       finally
  1166.       {
  1167.          this._trapProperties = false;
  1168.       }
  1169.       return this._propCage;
  1170.    }
  1171.    function convertObjectToRaw(values)
  1172.    {
  1173.       this._trapProperties = true;
  1174.       this._propCage = new Object();
  1175.       try
  1176.       {
  1177.          var _loc6_ = this._iterator.getSortInfo();
  1178.          var _loc4_ = undefined;
  1179.          var _loc7_ = undefined;
  1180.          var _loc2_ = undefined;
  1181.          var _loc3_ = 0;
  1182.          while(_loc3_ < _loc6_.keyList.length)
  1183.          {
  1184.             _loc2_ = _loc6_.keyList[_loc3_];
  1185.             _loc4_ = this.getField(_loc2_);
  1186.             _loc7_ = this.__toProperties[_loc6_.keyList[_loc3_]].type;
  1187.             switch(typeof values[_loc2_])
  1188.             {
  1189.                case "string":
  1190.                   _loc4_.setAsString(values[_loc2_]);
  1191.                   break;
  1192.                case "boolean":
  1193.                   _loc4_.setAsBoolean(values[_loc2_]);
  1194.                   break;
  1195.                case "number":
  1196.                   _loc4_.setAsNumber(values[_loc2_]);
  1197.                   break;
  1198.                case "object":
  1199.                   _loc4_.setTypedValue(new mx.data.binding.TypedValue(values[_loc2_],_loc7_.name,_loc7_));
  1200.             }
  1201.             _loc3_ = _loc3_ + 1;
  1202.          }
  1203.       }
  1204.       finally
  1205.       {
  1206.          this._trapProperties = false;
  1207.       }
  1208.       return this._propCage;
  1209.    }
  1210.    function decodeItem(item)
  1211.    {
  1212.       var _loc2_ = new Object();
  1213.       var _loc4_ = this.__curItem;
  1214.       this.__curItem = item;
  1215.       try
  1216.       {
  1217.          for(var _loc3_ in this.__toProperties)
  1218.          {
  1219.             _loc2_[_loc3_] = this.getField(_loc3_).getTypedValue().value;
  1220.          }
  1221.       }
  1222.       finally
  1223.       {
  1224.          this.__curItem = _loc4_;
  1225.       }
  1226.       return _loc2_;
  1227.    }
  1228.    function defaultSchema(obj)
  1229.    {
  1230.       var _loc2_ = undefined;
  1231.       var _loc3_ = undefined;
  1232.       var _loc4_ = "";
  1233.       for(var _loc6_ in obj)
  1234.       {
  1235.          _loc2_ = typeof obj[_loc6_];
  1236.          if(_loc2_ != "function")
  1237.          {
  1238.             _loc2_ = String(_loc2_.charAt(0)).toUpperCase() + _loc2_.substring(1,_loc2_.length);
  1239.             if(_loc2_ == "Boolean")
  1240.             {
  1241.                _loc3_ = "Bool";
  1242.             }
  1243.             else
  1244.             {
  1245.                _loc3_ = _loc2_.substring(0,3);
  1246.             }
  1247.             _loc4_ = "<property name=\"" + _loc6_ + "\"><type name=\"" + _loc2_ + "\" original=\"false\"><validation className=\"mx.data.types." + _loc3_ + "\"/></type></property>" + _loc4_;
  1248.          }
  1249.       }
  1250.       this.schema = new XML("<properties>" + _loc4_ + "</properties>");
  1251.    }
  1252.    function decodeValue(fieldName, value)
  1253.    {
  1254.       this._fldValObj.__schema = this.__schema;
  1255.       this._fldValObj[fieldName] = value;
  1256.       return this._fldValObj.getField(fieldName).getTypedValue().value;
  1257.    }
  1258.    function encodeValue(fieldName, value)
  1259.    {
  1260.       var _loc2_ = this.__toProperties[fieldName].type;
  1261.       this._fldValObj.__schema = this.__schema;
  1262.       this._fldValObj.getField(fieldName).setTypedValue(new mx.data.binding.TypedValue(value,_loc2_.name,_loc2_));
  1263.       return this._fldValObj[fieldName];
  1264.    }
  1265.    function findDelta(id)
  1266.    {
  1267.       var _loc2_ = 0;
  1268.       while(_loc2_ < this._deltaItems.length)
  1269.       {
  1270.          if(this._deltaItems[_loc2_]._id == id)
  1271.          {
  1272.             return this._deltaItems[_loc2_];
  1273.          }
  1274.          _loc2_ = _loc2_ + 1;
  1275.       }
  1276.       return null;
  1277.    }
  1278.    function internalDispatchEvent(type, params)
  1279.    {
  1280.       var _loc3_ = null;
  1281.       if(this._enableEvents >= 0)
  1282.       {
  1283.          _loc3_ = {type:type,target:this};
  1284.          if(params != undefined)
  1285.          {
  1286.             for(var _loc4_ in params)
  1287.             {
  1288.                _loc3_[_loc4_] = params[_loc4_];
  1289.             }
  1290.          }
  1291.          this._eventDispatcher.dispatchEvent(_loc3_);
  1292.       }
  1293.       else if(this._event != null && this._event.type == "modelChanged")
  1294.       {
  1295.          if(type == "modelChanged")
  1296.          {
  1297.             if(this._event.data.eventName != "sort" && this._event.data.eventName != "filter")
  1298.             {
  1299.                this._event.data = params;
  1300.             }
  1301.          }
  1302.       }
  1303.       else
  1304.       {
  1305.          this._event = {data:params,type:type};
  1306.       }
  1307.       return _loc3_;
  1308.    }
  1309.    function getDataProviderItem(item, desiredTypes)
  1310.    {
  1311.       var _loc5_ = new Object();
  1312.       var _loc4_ = undefined;
  1313.       var _loc8_ = this.__curItem;
  1314.       var _loc3_ = undefined;
  1315.       var _loc2_ = undefined;
  1316.       try
  1317.       {
  1318.          this.__curItem = item;
  1319.          for(var _loc7_ in this.__toProperties)
  1320.          {
  1321.             _loc3_ = desiredTypes[_loc7_];
  1322.             if(_loc3_ == null)
  1323.             {
  1324.                _loc3_ = "String";
  1325.             }
  1326.             _loc4_ = this.getField(_loc7_);
  1327.             _loc2_ = _loc4_.getTypedValue(_loc3_);
  1328.             if(_loc2_ == null)
  1329.             {
  1330.                _loc2_ = _loc4_.getTypedValue();
  1331.             }
  1332.             _loc5_[_loc7_] = _loc2_.value;
  1333.          }
  1334.       }
  1335.       finally
  1336.       {
  1337.          this.__curItem = _loc8_;
  1338.       }
  1339.       return _loc5_;
  1340.    }
  1341.    function getEditingData(fieldName, item, desiredTypes)
  1342.    {
  1343.       var _loc4_ = undefined;
  1344.       var _loc5_ = this.__curItem;
  1345.       var _loc2_ = undefined;
  1346.       try
  1347.       {
  1348.          this.__curItem = item;
  1349.          _loc2_ = desiredTypes[fieldName];
  1350.          if(_loc2_ == null)
  1351.          {
  1352.             _loc2_ = "String";
  1353.          }
  1354.          var _loc3_ = this.getField(fieldName);
  1355.          val = _loc3_.getTypedValue(_loc2_);
  1356.          if(val == null)
  1357.          {
  1358.             val = _loc3_.getTypedValue();
  1359.          }
  1360.          _loc4_ = val.value;
  1361.       }
  1362.       finally
  1363.       {
  1364.          this.__curItem = _loc5_;
  1365.       }
  1366.       return _loc4_;
  1367.    }
  1368.    function getDisplayValue(propName, index)
  1369.    {
  1370.       var _loc3_ = this.__curItem;
  1371.       var _loc2_ = "";
  1372.       try
  1373.       {
  1374.          this.__curItem = this.__items[index];
  1375.          _loc2_ = this.getField(propName).getAsString();
  1376.       }
  1377.       finally
  1378.       {
  1379.          this.__curItem = _loc3_;
  1380.       }
  1381.       return _loc2_;
  1382.    }
  1383.    function getCurrentItem()
  1384.    {
  1385.       var _loc2_ = this._iterator.getCurrentItem();
  1386.       if(_loc2_ == null)
  1387.       {
  1388.          if(this._iterator.hasNext())
  1389.          {
  1390.             _loc2_ = this._iterator.next();
  1391.             this._iterator.previous();
  1392.          }
  1393.          else
  1394.          {
  1395.             _loc2_ = this._iterator.previous();
  1396.             this._iterator.next();
  1397.          }
  1398.       }
  1399.       return _loc2_;
  1400.    }
  1401.    function getInternalIndex(index)
  1402.    {
  1403.       var _loc2_ = this._iterator.getItemAt(index);
  1404.       if(_loc2_ == null)
  1405.       {
  1406.          return -1;
  1407.       }
  1408.       return this._itemIndexById[_loc2_[mx.data.components.DataSet.ItemId]];
  1409.    }
  1410.    function getKeyInfo()
  1411.    {
  1412.       var _loc3_ = undefined;
  1413.       var _loc2_ = undefined;
  1414.       for(var _loc5_ in this._iterators)
  1415.       {
  1416.          _loc3_ = this._iterators[_loc5_];
  1417.          _loc2_ = _loc3_.getSortInfo();
  1418.          if(_loc5_ != mx.data.components.DataSet.DefaultIterator && (_loc2_.options & mx.data.components.datasetclasses.DataSetIterator.Unique) == mx.data.components.datasetclasses.DataSetIterator.Unique)
  1419.          {
  1420.             return {options:_loc2_.options,keyList:_loc2_.keyList.slice(0)};
  1421.          }
  1422.       }
  1423.       var _loc4_ = new Array();
  1424.       for(_loc5_ in this.__toProperties)
  1425.       {
  1426.          _loc4_.push(_loc5_);
  1427.       }
  1428.       return {options:mx.data.components.datasetclasses.DataSetIterator.Unique,keyList:_loc4_};
  1429.    }
  1430.    function getModDeltaInfo(id)
  1431.    {
  1432.       var _loc3_ = null;
  1433.       var _loc5_ = null;
  1434.       var _loc6_ = this._optDeltaItems[id];
  1435.       if(_loc6_ == undefined)
  1436.       {
  1437.          _loc3_ = this.__curItem;
  1438.          if(_loc3_.clone == undefined)
  1439.          {
  1440.             var _loc8_ = _loc3_.getPropertyData();
  1441.             if(_loc8_ != null)
  1442.             {
  1443.                _loc5_ = this.createItem(_loc8_);
  1444.             }
  1445.             else
  1446.             {
  1447.                _loc5_ = new Object();
  1448.             }
  1449.          }
  1450.          else
  1451.          {
  1452.             _loc5_ = _loc3_.clone();
  1453.          }
  1454.          var _loc2_ = undefined;
  1455.          var _loc4_ = undefined;
  1456.          for(var _loc7_ in _loc3_)
  1457.          {
  1458.             _loc2_ = _loc3_[_loc7_];
  1459.             if(typeof _loc2_ != "function")
  1460.             {
  1461.                _loc4_ = this.__toProperties[_loc7_];
  1462.                _loc5_[_loc7_] = _loc4_ != undefined ? this.getField(_loc7_).getTypedValue().value : _loc2_;
  1463.             }
  1464.          }
  1465.          _loc6_ = new mx.data.components.datasetclasses.DeltaImpl(id,_loc5_,mx.data.components.datasetclasses.DeltaPacketConsts.Modified);
  1466.          this._optDeltaItems[id] = _loc6_;
  1467.          this._hasDelta = this._hasDelta + 1;
  1468.          this._deltaItems.push(_loc6_);
  1469.       }
  1470.       return _loc6_;
  1471.    }
  1472.    function getPropertyValue(name)
  1473.    {
  1474.       return this.__curItem[name];
  1475.    }
  1476.    function getResolverFieldList()
  1477.    {
  1478.       var _loc2_ = new Object();
  1479.       for(var _loc3_ in this.__toProperties)
  1480.       {
  1481.          if(this._calcFields[_loc3_] == null && this.__toProperties[_loc3_].type.path == null)
  1482.          {
  1483.             _loc2_[_loc3_] = this.__toProperties[_loc3_];
  1484.          }
  1485.       }
  1486.       return _loc2_;
  1487.    }
  1488.    function getDPTransId()
  1489.    {
  1490.       return this.internalGetId() + ":" + new Date().toString();
  1491.    }
  1492.    function getSchemaObject(xmlInfo)
  1493.    {
  1494.       var _loc3_ = new Object();
  1495.       var _loc5_ = undefined;
  1496.       for(var _loc2_ in xmlInfo.attributes)
  1497.       {
  1498.          _loc5_ = xmlInfo.attributes[_loc2_];
  1499.          if(_loc2_ == "original")
  1500.          {
  1501.             _loc3_[_loc2_] = _loc5_ != "false" ? true : false;
  1502.          }
  1503.          else
  1504.          {
  1505.             _loc3_[_loc2_] = _loc5_;
  1506.          }
  1507.       }
  1508.       var _loc4_ = xmlInfo.childNodes;
  1509.       var _loc7_ = undefined;
  1510.       var _loc2_ = 0;
  1511.       while(_loc2_ < _loc4_.length)
  1512.       {
  1513.          _loc3_[_loc4_[_loc2_].nodeName] = this.getSchemaObject(_loc4_[_loc2_]);
  1514.          _loc2_ = _loc2_ + 1;
  1515.       }
  1516.       return _loc3_;
  1517.    }
  1518.    function getSchemaXML(nodeName, info)
  1519.    {
  1520.       var _loc5_ = "";
  1521.       var _loc2_ = undefined;
  1522.       for(var _loc6_ in info)
  1523.       {
  1524.          _loc2_ = info[_loc6_];
  1525.          if(typeof _loc2_ != "object" && _loc6_ != "cls")
  1526.          {
  1527.             _loc5_ += " " + _loc6_ + "=\"" + _loc2_ + "\"";
  1528.          }
  1529.       }
  1530.       var _loc4_ = "<" + nodeName + _loc5_ + ">";
  1531.       for(_loc6_ in info)
  1532.       {
  1533.          _loc2_ = info[_loc6_];
  1534.          if(typeof _loc2_ == "object")
  1535.          {
  1536.             _loc4_ += this.getSchemaXML(_loc6_,_loc2_);
  1537.          }
  1538.       }
  1539.       _loc4_ += "</" + nodeName + ">";
  1540.       return _loc4_;
  1541.    }
  1542.    function hasInvalidSchema()
  1543.    {
  1544.       if(this._invalidSchema == undefined)
  1545.       {
  1546.          this._invalidSchema = true;
  1547.          if(this.__schema.elements != null)
  1548.          {
  1549.             var _loc2_ = this.__schema.elements;
  1550.             for(var _loc3_ in _loc2_)
  1551.             {
  1552.                if(_loc2_[_loc3_].type.original == false)
  1553.                {
  1554.                   this._invalidSchema = false;
  1555.                   return this._invalidSchema;
  1556.                }
  1557.             }
  1558.          }
  1559.       }
  1560.       return this._invalidSchema;
  1561.    }
  1562.    function initCollection()
  1563.    {
  1564.       this.__items = new Array();
  1565.       this._itemIndexById = new Array();
  1566.       this.internalClearDeltaPacket();
  1567.    }
  1568.    function internalAddItem(item, index, rebuildIndx, pipeData)
  1569.    {
  1570.       var _loc7_ = undefined;
  1571.       if(item[mx.data.components.DataSet.ItemId] == null)
  1572.       {
  1573.          _loc7_ = this.internalGetId();
  1574.          item[mx.data.components.DataSet.ItemId] = _loc7_;
  1575.       }
  1576.       else
  1577.       {
  1578.          _loc7_ = item[mx.data.components.DataSet.ItemId];
  1579.       }
  1580.       if(index >= this.__items.length)
  1581.       {
  1582.          this.__items.push(item);
  1583.       }
  1584.       else
  1585.       {
  1586.          this.__items.splice(index,0,item);
  1587.       }
  1588.       this._enableEvents = this._enableEvents - 1;
  1589.       var _loc8_ = this._event;
  1590.       this._trapProperties = true;
  1591.       try
  1592.       {
  1593.          this._propCage = item;
  1594.          var _loc3_ = undefined;
  1595.          for(var _loc6_ in this.__toProperties)
  1596.          {
  1597.             _loc3_ = this.__toProperties[_loc6_];
  1598.             if(rebuildIndx && (item[_loc6_] == null && this._calcFields[_loc6_] == null))
  1599.             {
  1600.                this.getField(_loc6_).setAsString(this.__toProperties[_loc6_].type.value);
  1601.             }
  1602.             else if(item[_loc6_] != null && pipeData)
  1603.             {
  1604.                this.getField(_loc6_).setTypedValue(new mx.data.binding.TypedValue(item[_loc6_],_loc3_.type.name,_loc3_.type));
  1605.             }
  1606.          }
  1607.       }
  1608.       finally
  1609.       {
  1610.          this._enableEvents = this._enableEvents + 1;
  1611.          this._event = _loc8_;
  1612.          this._trapProperties = false;
  1613.       }
  1614.       if(this._calcFields.__length__ > 0)
  1615.       {
  1616.          this.__curItem = item;
  1617.          this._loading = true;
  1618.          try
  1619.          {
  1620.             this.internalDispatchEvent("calcFields");
  1621.          }
  1622.          finally
  1623.          {
  1624.             this._loading = false;
  1625.          }
  1626.       }
  1627.       this._allowReslv = true;
  1628.       if(rebuildIndx)
  1629.       {
  1630.          this.rebuildItemIndexById();
  1631.       }
  1632.       return _loc7_;
  1633.    }
  1634.    function internalClearDeltaPacket(transId)
  1635.    {
  1636.       if(transId == undefined || transId.length == 0)
  1637.       {
  1638.          this._optDeltaItems = new Array();
  1639.          this._deltaItems = new Array();
  1640.          this._dpIndexByTransId = new Array();
  1641.          this._lastTransId = "";
  1642.          this._dpTransIdCount = 0;
  1643.          this._hasDelta = 0;
  1644.       }
  1645.       else
  1646.       {
  1647.          var _loc2_ = this._dpIndexByTransId[transId];
  1648.          if(_loc2_ != undefined)
  1649.          {
  1650.             var _loc6_ = this._dpIndexByTransId[_loc2_.prevId].index;
  1651.             _loc6_ = _loc6_ != _loc2_.index ? _loc6_ : 0;
  1652.             var _loc5_ = _loc2_.index - _loc6_;
  1653.             this._deltaItems.splice(_loc6_,_loc5_);
  1654.             var _loc3_ = this._lastTransId;
  1655.             while(_loc3_ != transId)
  1656.             {
  1657.                _loc2_ = this._dpIndexByTransId[_loc3_];
  1658.                _loc3_ = _loc2_.prevId;
  1659.                _loc2_.index -= _loc5_;
  1660.             }
  1661.             delete this._dpIndexByTransId[transId];
  1662.             this._dpTransIdCount = this._dpTransIdCount - 1;
  1663.             if(this._dpTransIdCount == 0)
  1664.             {
  1665.                this._lastTransId = "";
  1666.             }
  1667.          }
  1668.       }
  1669.    }
  1670.    function internalGetId()
  1671.    {
  1672.       return "IID" + String(Math.round(Math.random() * 100000000000));
  1673.    }
  1674.    function internalFirst()
  1675.    {
  1676.       this._iterator.first();
  1677.       var _loc2_ = this._iterator.next();
  1678.       this._iterator.previous();
  1679.       return _loc2_;
  1680.    }
  1681.    function internalRemoveItem(item)
  1682.    {
  1683.       this.checkReadOnly();
  1684.       var _loc2_ = this._itemIndexById[item[mx.data.components.DataSet.ItemId]];
  1685.       var _loc3_ = _loc2_ != undefined;
  1686.       var _loc4_ = this.internalDispatchEvent("removeItem",{result:true,item:item});
  1687.       _loc3_ = _loc4_ == null || _loc4_.result;
  1688.       if(_loc3_)
  1689.       {
  1690.          this.__items.splice(_loc2_,1);
  1691.          this.rebuildItemIndexById();
  1692.          if(this.__logChanges)
  1693.          {
  1694.             this.logRemoveItem(item,false);
  1695.          }
  1696.          _loc4_ = {eventName:"removeItems",firstItem:_loc2_,lastItem:_loc2_,removedIDs:new Array(item[mx.data.components.DataSet.ItemId])};
  1697.          this.resyncIterators(_loc4_);
  1698.          this._allowReslv = this.__items.length > 0;
  1699.          this.__curItem = this.getCurrentItem();
  1700.          this.internalDispatchEvent("modelChanged",_loc4_);
  1701.          if(this._enableEvents < 0 && this._event != null)
  1702.          {
  1703.             this._event.data.lastItem = _loc2_;
  1704.          }
  1705.       }
  1706.       return _loc3_;
  1707.    }
  1708.    function initIterators()
  1709.    {
  1710.       var _loc2_ = null;
  1711.       if(this._iterators != undefined)
  1712.       {
  1713.          _loc2_ = this._iterators[mx.data.components.DataSet.DefaultIterator].getFilterFunc();
  1714.       }
  1715.       this._iterators = new Array();
  1716.       this._iterator = new mx.data.components.datasetclasses.DataSetIterator(mx.data.components.DataSet.DefaultIterator,this);
  1717.       this._iterator.setFilterFunc(_loc2_);
  1718.       this._iterators[mx.data.components.DataSet.DefaultIterator] = this._iterator;
  1719.       this._iterator.first();
  1720.       this.__curItem = this._iterator.next();
  1721.    }
  1722.    function isValidElement(el)
  1723.    {
  1724.       return el.type.original == false;
  1725.    }
  1726.    function logAddItem(item, piped, id)
  1727.    {
  1728.       if(id == undefined)
  1729.       {
  1730.          id = item[mx.data.components.DataSet.ItemId];
  1731.       }
  1732.       var _loc2_ = new mx.data.components.datasetclasses.DeltaImpl(id,!piped ? this.decodeItem(item) : item,mx.data.components.datasetclasses.DeltaPacketConsts.Added);
  1733.       this._optDeltaItems[id] = _loc2_;
  1734.       this._deltaItems.push(Object(_loc2_));
  1735.       this._hasDelta = this._hasDelta + 1;
  1736.    }
  1737.    function logRemoveItem(item, piped, id)
  1738.    {
  1739.       if(id == undefined)
  1740.       {
  1741.          id = item[mx.data.components.DataSet.ItemId];
  1742.       }
  1743.       var _loc3_ = this._optDeltaItems[id];
  1744.       item = !piped ? this.decodeItem(item) : item;
  1745.       var _loc6_ = _loc3_ != undefined ? _loc3_.getSource() : item;
  1746.       var _loc5_ = new mx.data.components.datasetclasses.DeltaImpl(id,_loc6_,mx.data.components.datasetclasses.DeltaPacketConsts.Removed);
  1747.       this._deltaItems.push(Object(_loc5_));
  1748.       if(_loc3_ != undefined && _loc3_.getOperation() == mx.data.components.datasetclasses.DeltaPacketConsts.Added)
  1749.       {
  1750.          delete this._optDeltaItems[id];
  1751.          this._hasDelta = this._hasDelta - 1;
  1752.       }
  1753.       else
  1754.       {
  1755.          delete this._optDeltaItems[id];
  1756.          this._optDeltaItems[id] = _loc5_;
  1757.          this._hasDelta = this._hasDelta + 1;
  1758.       }
  1759.    }
  1760.    function rebuildItemIndexById()
  1761.    {
  1762.       this._itemIndexById = new Array();
  1763.       var _loc3_ = undefined;
  1764.       var _loc2_ = 0;
  1765.       while(_loc2_ < this.__items.length)
  1766.       {
  1767.          _loc3_ = this.__items[_loc2_];
  1768.          this._itemIndexById[_loc3_[mx.data.components.DataSet.ItemId]] = _loc2_;
  1769.          _loc2_ = _loc2_ + 1;
  1770.       }
  1771.    }
  1772.    function removeProxy()
  1773.    {
  1774.       var _loc2_ = undefined;
  1775.       for(var _loc3_ in this.__toProperties)
  1776.       {
  1777.          _loc2_ = this.__toProperties[_loc3_];
  1778.          delete this[_loc2_];
  1779.          delete this["get_" + _loc2_];
  1780.          delete this["set_" + _loc2_];
  1781.       }
  1782.    }
  1783.    function resyncIterators(info)
  1784.    {
  1785.       for(var _loc3_ in this._iterators)
  1786.       {
  1787.          this._iterators[_loc3_].modelChanged(info);
  1788.       }
  1789.    }
  1790.    function setPropertyValue(name, value)
  1791.    {
  1792.       if(this._trapProperties)
  1793.       {
  1794.          this._propCage[name] = value;
  1795.       }
  1796.       else
  1797.       {
  1798.          if(this._calcFields[name] != undefined)
  1799.          {
  1800.             this.__curItem[name] = value;
  1801.          }
  1802.          else
  1803.          {
  1804.             this.checkReadOnly();
  1805.             var _loc7_ = this.__curItem[name];
  1806.             if(_loc7_ != value)
  1807.             {
  1808.                if(this.__logChanges)
  1809.                {
  1810.                   var _loc6_ = this.getModDeltaInfo(this.__curItem[mx.data.components.DataSet.ItemId]);
  1811.                   this.__curItem[name] = value;
  1812.                   if(_loc6_.getOperation() == mx.data.components.datasetclasses.DeltaPacketConsts.Modified)
  1813.                   {
  1814.                      var _loc9_ = _loc6_.getItemByName(name);
  1815.                      if(_loc9_ != null)
  1816.                      {
  1817.                         _loc7_ = this.encodeValue(name,_loc9_.oldValue);
  1818.                      }
  1819.                      if(_loc7_ != value)
  1820.                      {
  1821.                         new mx.data.components.datasetclasses.DeltaItem(mx.data.components.datasetclasses.DeltaItem.Property,name,{oldValue:this.decodeValue(name,_loc7_),newValue:this.decodeValue(name,value),message:""},Object(_loc6_));
  1822.                      }
  1823.                      else if(_loc6_.getChangeList().length == 1)
  1824.                      {
  1825.                         this.removeDelta(_loc6_);
  1826.                      }
  1827.                   }
  1828.                   else
  1829.                   {
  1830.                      _loc6_.getSource()[name] = this.decodeValue(name,value);
  1831.                   }
  1832.                }
  1833.                this.__curItem[name] = value;
  1834.             }
  1835.             if(this._calcFields.__length__ > 0)
  1836.             {
  1837.                this.internalDispatchEvent("calcFields");
  1838.             }
  1839.          }
  1840.          if(!this._loading)
  1841.          {
  1842.             var _loc10_ = this._itemIndexById[this.__curItem[mx.data.components.DataSet.ItemId]];
  1843.             var _loc4_ = {eventName:"updateField",fieldName:name,firstItem:_loc10_,lastItem:_loc10_};
  1844.             var _loc2_ = false;
  1845.             for(var _loc8_ in this._iterators)
  1846.             {
  1847.                _loc2_ = this._iterators[_loc8_].modelChanged(_loc4_) || _loc2_;
  1848.             }
  1849.             if(_loc2_)
  1850.             {
  1851.                this.internalDispatchEvent("modelChanged",{eventName:"sort"});
  1852.             }
  1853.             else
  1854.             {
  1855.                this.internalDispatchEvent("modelChanged",_loc4_);
  1856.             }
  1857.          }
  1858.       }
  1859.    }
  1860.    function removeSortInfo(fld, name)
  1861.    {
  1862.       if(fld.sortInfo != null)
  1863.       {
  1864.          delete fld.sortInfo[name];
  1865.       }
  1866.    }
  1867.    function removeDelta(d)
  1868.    {
  1869.       var _loc3_ = false;
  1870.       var _loc2_ = 0;
  1871.       while(!_loc3_ && _loc2_ < this._deltaItems.length)
  1872.       {
  1873.          _loc3_ = this._deltaItems[_loc2_] == d;
  1874.          _loc2_ = _loc2_ + 1;
  1875.       }
  1876.       if(_loc3_)
  1877.       {
  1878.          this._deltaItems.splice(_loc2_ = _loc2_ - 1,1);
  1879.          delete this._optDeltaItems[d.getId()];
  1880.          this._hasDelta = this._hasDelta - 1;
  1881.       }
  1882.       return _loc3_;
  1883.    }
  1884.    function __resolve(methodName)
  1885.    {
  1886.       var _loc3_ = null;
  1887.       if(this._allowReslv)
  1888.       {
  1889.          var propName = methodName.substring(4);
  1890.          if(methodName.substr(0,4) == "get_")
  1891.          {
  1892.             _loc3_ = function()
  1893.             {
  1894.                return this.getPropertyValue(propName);
  1895.             };
  1896.          }
  1897.          else if(methodName.substr(0,4) == "set_")
  1898.          {
  1899.             _loc3_ = function()
  1900.             {
  1901.                this.setPropertyValue(propName,arguments[0]);
  1902.             };
  1903.          }
  1904.          else
  1905.          {
  1906.             arguments.shift();
  1907.             _loc3_ = function()
  1908.             {
  1909.                this.__curItem[methodName].apply(this.__curItem,arguments);
  1910.                var _loc3_ = this.__curItem[mx.data.components.DataSet.ItemId];
  1911.                if(this.__logChanges)
  1912.                {
  1913.                   var _loc5_ = this.getModDeltaInfo(_loc3_);
  1914.                   new mx.data.components.datasetclasses.DeltaItem(mx.data.components.datasetclasses.DeltaItem.Method,methodName,{argList:arguments,message:""},Object(_loc5_));
  1915.                }
  1916.                var _loc4_ = this._itemIndexById[_loc3_];
  1917.                this.internalDispatchEvent("modelChanged",{eventName:"updateItems",firstItem:_loc4_,lastItem:_loc4_});
  1918.             };
  1919.          }
  1920.       }
  1921.       return _loc3_;
  1922.    }
  1923.    function updateItem(d)
  1924.    {
  1925.       var _loc8_ = d.getId();
  1926.       var _loc10_ = undefined;
  1927.       var _loc6_ = null;
  1928.       var _loc12_ = this.__logChanges;
  1929.       this.__logChanges = false;
  1930.       try
  1931.       {
  1932.          if(_loc8_ == null)
  1933.          {
  1934.             _loc10_ = d.getSource();
  1935.          }
  1936.          else
  1937.          {
  1938.             _loc10_ = {__ID__:_loc8_};
  1939.          }
  1940.          _loc6_ = this._iterator.find(_loc10_);
  1941.          if(_loc6_ != null)
  1942.          {
  1943.             var _loc9_ = this._itemIndexById[_loc6_[mx.data.components.DataSet.ItemId]];
  1944.             var _loc5_ = d.getChangeList();
  1945.             var _loc3_ = undefined;
  1946.             var _loc11_ = this.__curItem;
  1947.             try
  1948.             {
  1949.                this.__curItem = _loc6_;
  1950.                var _loc4_ = 0;
  1951.                while(_loc4_ < _loc5_.length)
  1952.                {
  1953.                   _loc3_ = mx.data.components.datasetclasses.DeltaItem(_loc5_[_loc4_]);
  1954.                   this.getField(_loc3_.name).setTypedValue(new mx.data.binding.TypedValue(_loc3_.curValue,this.__toProperties[_loc3_.name].type.name,this.__toProperties[_loc3_.name].type));
  1955.                   _loc4_ = _loc4_ + 1;
  1956.                }
  1957.             }
  1958.             finally
  1959.             {
  1960.                this.__curItem = _loc11_;
  1961.             }
  1962.             this.internalDispatchEvent("modelChanged",{eventName:"updateItems",firstIndex:_loc9_,lastIndex:_loc9_});
  1963.          }
  1964.          else
  1965.          {
  1966.             _global.__dataLogger.logData(null,"Couldn\'t find the following item:",d.getSource());
  1967.          }
  1968.       }
  1969.       finally
  1970.       {
  1971.          this.__logChanges = _loc12_;
  1972.       }
  1973.    }
  1974. }
  1975.